// 导入处理路由的API
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
// 配置路由
const routes: Array<RouteRecordRaw> = [
  {
    path:'/',
    redirect: '/guide'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue')
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('@/views/MyView.vue')
  },
  {
    path: '/city',
    name: 'city',
    component: () => import('@/views/CityView.vue')
  },
  {
    path: '/guide',
    name: 'guide',
    component: () => import('@/views/GuideView.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/RegisterView.vue')
  },
  {
    // 登录（邮箱登录）
    path: '/login',
    name: 'login',
    component: () => import('@/views/LoginView.vue')
  },
  {
    path: '/login_list',
    name: 'loginlist',
    component: () => import('@/views/LoginListView.vue')
  },
  {
    path: '/email_login',
    name: 'emaillogin',
    component: () => import('@/views/EmailLoginView.vue')
  },
  {
    path: '/other',
    name: 'other',
    component: () => import('@/views/OtherView.vue')
  },
  {
    // 登录（账号密码）
    path: '/sigin',
    name: 'sigin',
    component: () => import('@/views/SiginView.vue')
  }
  ,
  {
    // 详情
    path: '/detail',
    name: 'detail',
    component: () => import('@/views/DetailView.vue')
  }
  ,
  {
    // 搜索
    path: '/search',
    name: 'search',
    component: () => import('@/views/SearchView.vue')
  }
  ,
  {
     // 编辑用户资料
      path: '/edit',
      name: 'edit',
      component: () => import('@/views/EditUserInfoView.vue')
    }
    ,
  {
     // 我的收藏
      path: '/like',
      name: 'like',
      component: () => import('@/views/LikeView.vue')
    }
    ,
    {
       // 注销账号
        path: '/remove',
        name: 'remove',
        component: () => import('@/views/RemoveUserView.vue')
      }
]
// 创建路由
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

// 导出路由
export default router
